# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BackupDR.V1.Model.DataSource do
  @moduledoc """
  Message describing a DataSource object. Datasource object used to represent Datasource details for both admin and basic view.

  ## Attributes

  *   `backupConfigInfo` (*type:* `GoogleApi.BackupDR.V1.Model.BackupConfigInfo.t`, *default:* `nil`) - Output only. Details of how the resource is configured for backup.
  *   `backupCount` (*type:* `String.t`, *default:* `nil`) - Number of backups in the data source.
  *   `configState` (*type:* `String.t`, *default:* `nil`) - Output only. The backup configuration state.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the instance was created.
  *   `dataSourceBackupApplianceApplication` (*type:* `GoogleApi.BackupDR.V1.Model.DataSourceBackupApplianceApplication.t`, *default:* `nil`) - The backed up resource is a backup appliance application.
  *   `dataSourceGcpResource` (*type:* `GoogleApi.BackupDR.V1.Model.DataSourceGcpResource.t`, *default:* `nil`) - The backed up resource is a Google Cloud resource. The word 'DataSource' was included in the names to indicate that this is the representation of the Google Cloud resource used within the DataSource object.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Server specified ETag for the ManagementServer resource to prevent simultaneous updates from overwiting each other.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user provided metadata. No labels currently defined:
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. Name of the datasource to create. It must have the format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. `{datasource}` cannot be changed after creation. It must be between 3-63 characters long and must be unique within the backup vault.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The DataSource resource instance state.
  *   `totalStoredBytes` (*type:* `String.t`, *default:* `nil`) - The number of bytes (metadata and data) stored in this datasource.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the instance was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :backupConfigInfo => GoogleApi.BackupDR.V1.Model.BackupConfigInfo.t() | nil,
          :backupCount => String.t() | nil,
          :configState => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :dataSourceBackupApplianceApplication =>
            GoogleApi.BackupDR.V1.Model.DataSourceBackupApplianceApplication.t() | nil,
          :dataSourceGcpResource => GoogleApi.BackupDR.V1.Model.DataSourceGcpResource.t() | nil,
          :etag => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :totalStoredBytes => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:backupConfigInfo, as: GoogleApi.BackupDR.V1.Model.BackupConfigInfo)
  field(:backupCount)
  field(:configState)
  field(:createTime, as: DateTime)

  field(:dataSourceBackupApplianceApplication,
    as: GoogleApi.BackupDR.V1.Model.DataSourceBackupApplianceApplication
  )

  field(:dataSourceGcpResource, as: GoogleApi.BackupDR.V1.Model.DataSourceGcpResource)
  field(:etag)
  field(:labels, type: :map)
  field(:name)
  field(:state)
  field(:totalStoredBytes)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.BackupDR.V1.Model.DataSource do
  def decode(value, options) do
    GoogleApi.BackupDR.V1.Model.DataSource.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BackupDR.V1.Model.DataSource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
